#!/usr/bin/python
"""OSPF router web interface."""
from distutils.core import setup
import glob
import os

VERSION = "0.1"

def get_data_files():
    def get_files(directory):
        for filename in glob.glob(os.path.join(directory, "*")):
            if os.path.isfile(filename):
                yield filename

    directories = [
        "static/css",
        "static/images",
        "static/javascript",
        "templates",
        "templates/layouts",
        "examples",
    ]
                
    yield "/etc/uya", [
            "config/cherrypy.conf",
#            "config/uya.conf",
        ]       
    yield "/etc/uya/scripts", [
            "scripts/write.sh",
            "scripts/read.sh",
        ]       

    yield "/var/spool/uya", []
                 
    header = "share/uya"
    yield header, [
            "config/uya.template.conf", 
            "config/uya.view.conf",
            "config/uya-web.conf",
        ]                
    for directory in directories:
         yield os.path.join(header, directory), list(get_files(directory))            
    
setup(
    name="uya",
    description="OSPF router web interface",
    version=VERSION,
    author="Arnau Sanchez",
    author_email="tokland@gmail.com",
    url="http://code.google.com/p/uya",
    packages=[
        "uya", 
        "uya/routerconf", 
        "uya/routerconf/configmod",
        "uya/routerconf/configmod/configobj",
        "uya/configmod_web"],
    scripts=[
		"bin/uya",
		"bin/uya-web",
	],
    license="GNU Public License v3.0",
    long_description=" ".join(__doc__.strip().splitlines()),
    data_files=list(get_data_files()),
)
